package com.ruoyi.driver.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.driver.mapper.TbDriverAddressMapper;
import com.ruoyi.driver.domain.TbDriverAddress;
import com.ruoyi.driver.service.ITbDriverAddressService;

/**
 * 顺风单地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-27
 */
@Service
public class TbDriverAddressServiceImpl implements ITbDriverAddressService 
{
    @Autowired
    private TbDriverAddressMapper tbDriverAddressMapper;

    /**
     * 查询顺风单地址
     * 
     * @param addressId 顺风单地址主键
     * @return 顺风单地址
     */
    @Override
    public TbDriverAddress selectTbDriverAddressByAddressId(Integer addressId)
    {
        return tbDriverAddressMapper.selectTbDriverAddressByAddressId(addressId);
    }

    /**
     * 查询顺风单地址列表
     * 
     * @param tbDriverAddress 顺风单地址
     * @return 顺风单地址
     */
    @Override
    public List<TbDriverAddress> selectTbDriverAddressList(TbDriverAddress tbDriverAddress)
    {
        return tbDriverAddressMapper.selectTbDriverAddressList(tbDriverAddress);
    }

    /**
     * 新增顺风单地址
     * 
     * @param tbDriverAddress 顺风单地址
     * @return 结果
     */
    @Override
    public int insertTbDriverAddress(TbDriverAddress tbDriverAddress)
    {
        tbDriverAddress.setCreateTime(DateUtils.getNowDate());
        return tbDriverAddressMapper.insertTbDriverAddress(tbDriverAddress);
    }

    /**
     * 修改顺风单地址
     * 
     * @param tbDriverAddress 顺风单地址
     * @return 结果
     */
    @Override
    public int updateTbDriverAddress(TbDriverAddress tbDriverAddress)
    {
        tbDriverAddress.setUpdateTime(DateUtils.getNowDate());
        return tbDriverAddressMapper.updateTbDriverAddress(tbDriverAddress);
    }

    /**
     * 批量删除顺风单地址
     * 
     * @param addressIds 需要删除的顺风单地址主键
     * @return 结果
     */
    @Override
    public int deleteTbDriverAddressByAddressIds(Integer[] addressIds)
    {
        return tbDriverAddressMapper.deleteTbDriverAddressByAddressIds(addressIds);
    }

    /**
     * 删除顺风单地址信息
     * 
     * @param addressId 顺风单地址主键
     * @return 结果
     */
    @Override
    public int deleteTbDriverAddressByAddressId(Integer addressId)
    {
        return tbDriverAddressMapper.deleteTbDriverAddressByAddressId(addressId);
    }
}
